package com.ec.bl.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ec.bl.domain.dto.RefundRecordDTO;
import com.ec.bl.domain.dto.RefundQueryRequest;
import com.ec.bl.domain.entity.RefundRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RefundRecordMapper extends BaseMapper<RefundRecord> {

    /**
     * 分页查询退款记录（带关联信息）
     */
    IPage<RefundRecordDTO> selectRefundRecordPage(Page<RefundRecordDTO> page, @Param("query") RefundQueryRequest query);

    /**
     * 根据ID查询退款记录详情
     */
    RefundRecordDTO selectRefundRecordById(@Param("id") Long id);

    /**
     * 查询用户的退款记录
     */
    List<RefundRecordDTO> selectRefundRecordsByUserId(@Param("elderlyUserId") Long elderlyUserId);
}